/**
 * gislin 2017年7月17日
 */
package com.btcode.orm.filter;

import com.btcode.db.wherefilter.IWhereFilter;
import com.btcode.db.wherefilter.WhereFilterSingle;
import com.btcode.db.wherefilter.WhereFilterType;
import com.btcode.orm.model.IField;

/**
 * @author gislin 2017年7月17日
 */
public class FilterSingle implements IFilter {

    IField field;

    WhereFilterType fileterType;

    Object value;

    public FilterSingle(IField field, WhereFilterType whereFilterType, Object value) {
        this.field = field;
        this.fileterType = whereFilterType;
        this.value = value;
    }

    @Override
    public IWhereFilter getWhereFilter() {

        IWhereFilter whereFilter = new WhereFilterSingle(field.getTableName(), field.getFieldName(),
                                                         fileterType, value);
        return whereFilter;

    }
}
